<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
  <meta charset="utf-8">
  <title>存证溯源界面</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script>
    function myFun(type) {
      //window.open('','','width=200,height=100');
      //var username="[[${model_id}]]";
      var model_id = "[[${model_id}]]"
      //弹出窗口的宽度;
      var iHeight = 600;                        //弹出窗口的高度;
      var iWidth = 400;
      var iTop = (window.screen.height - 30 - iHeight) / 2;       //获得窗口的垂直位置;
      var iLeft = (window.screen.width - 10 - iWidth) / 2;        //获得窗口的水平位置;
      var str = "width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + ",location=no";
      window.open("/" + type + "?model_id=" + model_id, "", str)
    }

     function myFun2(type,time) {
      var model_id = "[[${model_id}]]";
      //弹出窗口的宽度;
      var iHeight = 600;                        //弹出窗口的高度;
      var iWidth = 400;
      var iTop = (window.screen.height - 30 - iHeight) / 2;       //获得窗口的垂直位置;
      var iLeft = (window.screen.width - 10 - iWidth) / 2;        //获得窗口的水平位置;
      var str = "width=" + iWidth + ",height=" + iHeight + ",top=" + iTop + ",left=" + iLeft + ",location=no";
         if (type=="训练") {
        type="train";
      }
      if (type=="使用") {
        type="use";
      }
      if (type=="交易") {
        type="trade";
      }
      window.open("/" + type + "?model_id=" + model_id+"&time="+time, "", str)
    }


  </script>
  <style>
    * {
      padding: 0;
      margin: 0;
    }

    html,
    body {
      height: 100%;
      width: 100%;
    }

    /* .top,.bottom{
        position: absolute;
        height: 50px;
        background-color: red;
        left: 0;
        right: 0;
    }
    .top{
        top:0;
        float: left;
    }
    .bottom{
        bottom:0;
        float: left;
    }
    .center{
        position: absolute;
        top: 50px;
        bottom: 50px;
        left: 0;
        right: 0;
        background-color: antiquewhite;
        overflow: auto;
    } */
    .myleft {
      float: left;
      background-color: gray;
      width: 10%;
      height: 100%;
    }

    .myright {
      float: left;
      background-color: white;
      width: 90%;
      height: 100%;
    }

    .mytop {
      width: 100%;
      height: 5%;
      background-color: black;
    }

    .content {
      width: 100%;
      height: 95%;
    }

    .topleft {
      float: left;
      background-color: black;
      width: 10%;
      height: 100%;
    }

    .topright {
      float: left;
      background-color: grey;
      width: 90%;
      height: 100%;
    }

    .myimg {
      margin-left: 5px;
      margin-top: 5px;
    }

    .mylabel {
      width: 100px;
      height: 100px;
      margin: 0 auto;
      background-color: white;
    }

    .myright {
      position: relative;
    }

    .mycertify {
      position: absolute;
      top: 10px;
      left: 10px;
      height: 800px;
      width: 400px;
      border: 1px solid black;
      text-align: center;
    }

    .mysource {
      position: absolute;
      top: 10px;
      left: 500px;
      height: 800px;
      width: 400px;
      border: 1px solid black;
      text-align: center;
    }

    .mycertify_head {
      position: absolute;
      top: 160px;
      left: 20px;
      height: 50px;
      width: 300px;
      border: 1px solid black;
      font-weight: bold
    }
    .my-certify-head {
      font-weight: bold
    }
    .my-mysource-head {
      font-weight: bold
    }
  </style>
</head>

<body>
  <div class="mytop">
    <div class="topleft">
      <img src="v2_pvlpys.png" class="myimg" alt="">
    </div>
    <div class="topright">

    </div>
  </div>


  <div class="content">
    <!-- <div class="top">定高</div>
  <div class="center">自适应</div>
  <div class="bottom">定高</div> -->
    <div class="myleft">
      <div>
        <form name="input" action="search_model" method="get">
          <input type="text" name="model_id">
          <input type="submit" value="提交">
        </form>
      </div>
      <div>
        <div class="mylabel">
          111
        </div>
      </div>
    </div>
    <div class="myright">
      <div class="mycertify">
        <br>
        <div class="my-certify-head">
          模型存证
        </div>
        <br>
        <div>
          模型号：
          <text th:text="${model_id}"></text>
          <a href="" onclick="myFun('query_model_info')">模型详情</a><br>
        </div><br>

        <div>
          上传人：
          <text th:text="${producer_id}"></text>
          <a href="" onclick="myFun('query_upload_info')">上传详情</a><br>
        </div><br>
        <div>
          审核人： <text th:text="${verifyer_id}"></text>
          <a href="" onclick="myFun('query_verify_info')">审核详情</a><br>
        </div><br>
        <div>
          认证人：<text th:text="${certifer_id}"></text>
          <a href="" onclick="myFun('query_certify_info')">认证详情</a><br>
        </div>
      </div>
      <div class="mysource">
        <div class="my-mysource-head"><br>
          模型溯源
        </div><br>
        <div class="alltext">
          <script type="text/javascript">
            var str="[[${state}]]";
            str=str.replaceAll("&quot;","\"")
            var state=eval(str);
            for (var i = 0; i < state.length; i++) {
              a = '<div class="mytext" onclick="myFun2(\''+state[i].type+'\',\''+state[i].time+'\')">';
              a += ' <div class="mytext_number">';
              a+='<div>版本号：</div><div>100</div></div>';
              a+='<div class="mytext_number"><div>类型：</div><div><text th:text="${type}">'+state[i].type+'</text></div></div>'
              a+='<div class="mytext_number"><div>人员：</div><div><text th:text="${operator}">'+state[i].operator+'</text></div></div>'
              a += '</div><br>'
              document.write(a);
              }
          </script>
        </div>
        <style>
          .mytext{
            border: 2px solid black;
            width: 50% ;height: 85px;
            margin: 0 auto;
          }
          .mytext_number{
            display: flex;
            margin-top: 5px;
            margin-left: 20px;
            margin-right: 20px;
            justify-content: space-between;
          }
          .alltext{
            /* border: 2px solid black; */
            text-align:center;
            width: 100%;
            height: 100%;

          }
          .trace {
            width: 50%;
            height: 15%;
            margin-bottom: 8px;
            border: 2px solid;
            margin: auto;
          }
          .myrigth_text {
            float: right;
          }
        </style>
      </div>
    </div>
  </div>

</body>

</html>